package com.kude.service;

import java.util.List;

import org.hibernate.criterion.Order;

import com.kude.entity.Article;
import com.kude.entity.ShopIntroduction;
import com.kude.manager.OperException;
import com.kude.manager.ShopIntroductionManager;
import com.kude.util.BeanFactory;

public class ShopIntroductionService {

	private ShopIntroductionManager shopIntroductionManager;

	/**
	 * 根据ID获取
	 * 
	 * @param id
	 * @return
	 * @throws OperException
	 */
	public ShopIntroduction getShopIntroduction(int id) throws OperException {
		return shopIntroductionManager.get(id);
	}
	
	/**
	 * 更新
	 * 
	 * @param article
	 * @throws OperException
	 */
	public void updateShopIntroduction(ShopIntroduction shopIntroduction) throws OperException {
		shopIntroductionManager.update(shopIntroduction);
	}
	
	/**
	 * 根据ID删除
	 * @param articleManager
	 */
	public void deleteShopIntroduction(int id) throws OperException{
		shopIntroductionManager.delete(id);
	}
	
	/**
	 * 增加
	 * 
	 */
	public void addShopIntroduction(ShopIntroduction shopIntroduction) throws OperException{
		shopIntroductionManager.add(shopIntroduction);
	}
	
	/**
	 * 输出limit条记录
	 * @param offset
	 * @param limit
	 * @return
	 * @throws OperException
	 */
	public List getsomeImage(int offset, int limit) throws OperException{
		Order order = Order.desc("shopId");
		return shopIntroductionManager.find(order, offset, limit);
	}

	public void setShopIntroductionManager(
			ShopIntroductionManager shopIntroductionManager) {
		this.shopIntroductionManager = shopIntroductionManager;
	}

	
	
	
}
